Shader "Custom/M3"
{
    SubShader{
    	Pass{
    		CGPROGRAM
    		#pragma vertex vert
    		#pragma fragment frag
    		
    		struct a2v{
    			// 告诉Unity把模型空间下的顶点坐标填充给 _vertex
    			float4 vertex : POSITION;
    			// 告诉Unity把模型空间下的法线填充给 _normal
    			float3 normal : NORMAL;
    			// 告诉Unity把第一套纹理坐标填充给 _texcoord
    			float4 texcoord : TEXCOORD0;
    		};
    		
    		struct v2f{
    			float4 position : SV_POSITION;
    			float3 normal : COLOR0;
    		};
    		
    		v2f vert(a2v v) {
    			v2f f;
    			f.position = UnityObjectToClipPos(v.vertex);
    			f.normal = v.normal;
    			return f;
    		}
    		
    		fixed4 frag(v2f f) : SV_Target{
    			return fixed4(f.normal,1);
    		}
    		ENDCG
    	}
    }
    Fallback "VertexLit"
}